package anthology.daily_question._25_01;
//https://leetcode.cn/problems/number-of-ways-to-split-array/description/?envType=daily-question&envId=2025-01-13
public class _2270分割数组的方案数 {
    class Solution {
        public int waysToSplitArray(int[] nums) {
            long sum = 0, pre = 0;
            int count = 0;
            for(int i : nums){
                sum += i;
            }
            for(int i=0; i<nums.length-1; i++){
                pre += nums[i];
                if(pre >= sum - pre){
                    count++;
                }
            }
            return count;
        }
    }
}
